﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel.Composition;
using HomePageAddInAdorner;
using System.ComponentModel.Composition.Hosting;
using HomePageAddIn;

namespace Dashboard
{
    /// <summary>
    /// Interaction logic for HomePage.xaml
    /// </summary>
    /// 
    [Serializable]
    public partial class HomePage : UserControl
    {
        DirectoryCatalog catalog;
        CompositionContainer container;
        ColumnExtensionImporter columnsImporter;
        public HomePage()
        {
            InitializeComponent();
            InitializeExtensions();
        }
        public void InitializeExtensions()
        {
            catalog = new DirectoryCatalog(@"C:\WorkSpace\Microsoft\DashboardAddIn\PipeLine\AddIns\HomePageAddIn\");

            container = new CompositionContainer(catalog);
            columnsImporter = new ColumnExtensionImporter();

            var batch = new CompositionBatch();
            batch.AddPart(columnsImporter);
            container.Compose(batch);
            foreach (var a in columnsImporter.Columns)
            {
                this.textBlock1.Text += a.ColumnName();
            }
        }
    }
}
